home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / modem / wxtermsr.arc / WXTMMISC.INC < prev    next >
Text File  |  1988-02-12  |  1KB  |  62 lines

  1. {$U-,C-,R-}
  2. FUNCTION scan(VAR extend : BOOLEAN; VAR code : Byte) : BOOLEAN;
  3. {
  4.  Uses BIOS service 16 to get a keystroke w/o echo. Sets 'extend' true
  5.  for extended codes from PC-Clone keyboards, and returns ASCII/Scan code
  6.  in 'code'.  Returns true if a character exists, false if none is in the
  7.  buffer.
  8. }
  9. TYPE
  10.     regs = RECORD
  11.       ax,bx,cx,dx,bp,si,di,ds,es,flags : INTEGER;
  12.     END;
  13. VAR
  14.    r : regs;
  15.    c : INTEGER;
  16. BEGIN
  17.      code := 0;
  18.      r.ax := 1 ShL 8;     {AH := 1}
  19.      Intr($16,r);
  20.      IF r.flags AND 64 <> 64 THEN
  21.      BEGIN
  22.     r.ax := 0;
  23.     Intr($16,r);     {Get character and clear from buffer}
  24.     code := Lo(r.ax);
  25.     scan := TRUE;
  26.     extend := FALSE;
  27.     if  code = 0 THEN
  28.     begin
  29.        extend := TRUE;
  30.        code := Hi(r.ax)
  31.     end;
  32.      END
  33.      ELSE
  34.     scan := FALSE;
  35. END;
  36.  
  37. FUNCTION exists(fname :  bigstring) : BOOLEAN;
  38. VAR
  39.    f : FILE;
  40. BEGIN
  41.      Assign(f, fname);
  42.      {$I-}
  43.      RESET(f);
  44.      {$I+}
  45.      IF IOResult = 0 THEN
  46.     begin
  47.          exists := TRUE;
  48.          CLOSE(f)
  49.     end
  50.      ELSE
  51.     exists := FALSE
  52. END;
  53.  
  54. PROCEDURE supcase(VAR s);
  55. VAR
  56.    ss : bigstring Absolute s;
  57.    i : INTEGER;
  58. BEGIN
  59.      FOR i := 1 TO LENGTH(ss) DO
  60.      ss[i] := UpCase(ss[i])
  61. END;
  62.